Skip to content

fix: implement missing utilities and fix edge-case bugs - #266

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2479-1785040082
Open

fix: implement missing utilities and fix edge-case bugs#266
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2479-1785040082

Conversation

@stooit

@stooit stooit commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 previously-failing tests and implements missing functionality across the utility library. All 60 tests now pass with no regressions.

Changes

  • src/calculator.tsdivide now throws Error("Division by zero") when the divisor is 0 (previously returned Infinity).
  • src/date-utils.tsformatRelative uses Math.round for the hours→days conversion, fixing an off-by-one that reported "1 day ago" for ~36h diffs.
  • src/validator.tsisEmail regex widened to accept long TLDs (e.g. .museum); isUrl no longer rejects URLs with ports (e.g. http://localhost:3000).
  • src/string-utils.ts — implemented truncate (word-boundary truncation with "..." counting toward maxLength) and wordCount.
  • src/task-manager.ts — implemented remove, update, and sortBy.

Testing

bun test60 pass, 0 fail.

Notes / assumptions

  • No test files were modified and no new dependencies were added, per task constraints.
  • Fixes are test-driven; behaviour follows what the existing tests expect.

🤖 Generated autonomously.

- calculator: throw on division by zero
- date-utils: round hours-to-days in formatRelative to fix off-by-one
- validator: allow long TLDs in isEmail and ports in isUrl
- string-utils: implement truncate and wordCount
- task-manager: implement remove, update, and sortBy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant